/*登录界面*/
void ui_sign_in()
{
    char password[15];
    char input;
    FILE *f = fopen(".password", "r");
    if (!f)
    {
        /*不存在密码文件就创建*/
        ui_set_password();
        return;
    }
    fscanf(f, "%s", password);
    fclose(f);
    int i = 0;
    while (password[i])
    {
        password[i] -= 10;
        i++;
    }
    system("cls");
    printf("SIGN IN\nPassword:");
    i = 0;
    while (password[i])
    {
        input = getch(); /*此处无回显*/
        if (input != password[i])
        {
            printf("\n\033[31m密码错误\033[0m\n");
            Sleep(1000);
            ui_sign_in();
        }
        i++;
    }
}
/*设定密码界面*/
void ui_set_password()
{
    system("cls");
    FILE *f = fopen(".password", "w");
    char password[20];
    printf("SIGN UP\n");
    printf("Password:");
    scanf("%s", password);
    int i = 0;
    while (password[i])
    {
        password[i] += 10;
        i++;
    }
    fprintf(f, "%s", password);
    fclose(f);
}